<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>用户身体指标信息</title>
        <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" href="<%=basePath%>css/weui.css" />
		
<link rel="stylesheet" href="<%=basePath%>css/example.css" />
<script type="text/javascript" src="<%=basePath%>js/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/jquery.js"></script>
  </head>
  <script type="text/javascript">
var basePath="<%=basePath%>";
// 屏蔽屏幕自身手势
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
 </script>
  <script type="text/javascript">
  function toSave(){
  var url=basePath+"user/addUserInfo.spring";
  var height=$("#height").val();
  var weight=$("#weight").val();
  var highbloodPressure=$("#highbloodPressure").val();
  var lowBloodPressure=$("#lowBloodPressure").val();
  var pulse=$("#pulse").val();
  var hipLine=$("#hipLine").val();
  var abdominalLine=$("#abdominalLine").val();
  if(height==""){
  alert("请填写身高");
  return false;
  }else if(weight==""){
  alert("请填写体重");
  return false;
  }else{
  $.ajax({
	　　url : url,
	　　data : {height:height,weight:weight,highbloodPressure:highbloodPressure,pulse:pulse,hipLine:hipLine,abdominalLine:abdominalLine,lowBloodPressure:lowBloodPressure},
	　　type : "POST",
	   dataType : 'json',
	　　success : function(data) {
		if(data.resultCode==1){
						alert("提交成功");
						window.location.href = basePath+"jsp/index.jsp";
					}else if(data.resultCode==0){
					alert("提交失败，请稍后重试");
					}else{
					alert("提交失败，请稍后重试");
					}
	　　},
	});
  }
  }

  
  </script>
  
  <body ontouchstart>
  <div class="container js_container">

  </div>

<h5 style="text-align: center;color: green;margin: 5px;">请您录入信息  <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default"  onclick="toIgnore();" style="position: absolute;right: 0;margin: 5px;">跳过</a></h5>

  <div class="weui_cells">

            <div class="weui_cell">
               <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label" style="width: 7em">血压(mmHg)：</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" pattern="[0-9]*" placeholder="" id="highbloodPressure" style="width: 40%">/
                      <input class="weui_input" type="number" pattern="[0-9]*" placeholder="" id="lowBloodPressure"style="width: 40%">
                </div>
            </div>
            </div>
             <div class="weui_cell">
               <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label" style="width: 7em">脉搏(次/分)：</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" pattern="[0-9]*" placeholder="请输入脉搏" id="pulse">
                </div>
            </div>
            </div>
			<div class="weui_cell">
               <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label" style="width: 7em">臀围(cm)：</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" pattern="[0-9]*" placeholder="请输入臀围" id="hipLine">
                </div>
            </div>
            </div>
            <div class="weui_cell">
               <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label" style="width: 7em"><span style="color: red">*</span> 身高(cm)：</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" pattern="[0-9]*" placeholder="请输入身高" id="height">
                </div>
            </div>
            </div>
            <div class="weui_cell">
               <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label" style="width: 7em"><span style="color: red">*</span> 体重(kg)：</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" pattern="[0-9]*" placeholder="请输入体重" id="weight">
                </div>
            </div>
            </div>
            <div class="weui_cell">
               <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label" style="width: 7em">腹围(cm)：</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" pattern="[0-9]*" placeholder="请输入腹围" id="abdominalLine">
                </div>
            </div>
            </div>
        </div>
        <div class="weui_btn_area">
			<a class="weui_btn weui_btn_primary login" href="javascript:"
				id="showTooltips" onclick="toSave();">提交</a>
			
		</div>
	
		
  </body>
  
  <script type="text/javascript">
  function toIgnore(){
 	window.location.href = basePath+"jsp/index.jsp";
  }
  </script>
</html>
